package com.sky.mapper;

import com.sky.entity.GUser;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface GUserMapper {

  @Select("select * from guser where guser_email = #{guserEmail}")
  GUser selectUserByEmail(String guserEmail);

  @Insert("INSERT INTO guser (guser_email, guser_password) VALUES (#{guserEmail}, #{guserPassword})")
  @Options(useGeneratedKeys = true, keyProperty = "guserId")
  void insertGUser(GUser gUser);

  void updateUser(GUser gUser);

  @Select("select * from guser where guser_id=#{guserId}")
  GUser selectUserById(int gUserId);
}
